---
id: 660f4de78f775e480ba2e451
title: Step 98
challengeType: 1
dashedName: step-98
---

# --description--

The `.unshift()` method of an array allows you to add a value to the **beginning** of the array, unlike `.push()` which adds the value at the end of the array. Here is an example:

```js
const numbers = [1, 2, 3];
numbers.unshift(5);
```

The `numbers` array would now be `[5, 1, 2, 3]`.

Use `const` to declare an `unshifted` variable, and assign it the result of calling `.unshift()` on your `numbers` array. Pass `5` as the argument. Then print your `unshifted` variable.

# --hints--

You should declare your `unshifted` variable.

```js
assert.match(code, /const\s+unshifted/);
```

You should call the `.unshift()` method on your `numbers` array.

```js
assert.match(code, /numbers\.unshift\(/);
```

You should pass `5` as the argument to your `.unshift()` call.

```js
assert.deepEqual(numbers, [5,1,2,3]);
```

You should assign the result of your `.unshift()` call to your `unshifted` variable.

```js
assert.equal(unshifted, 4);
```

# --seed--

## --seed-contents--

```js
const character = "#";
const count = 8;
const rows = [];

function padRow(rowNumber, rowCount) {
  return " ".repeat(rowCount - rowNumber) + character.repeat(2 * rowNumber - 1) + " ".repeat(rowCount - rowNumber);
}

// TODO: use a different type of loop
/*for (let i = 1; i <= count; i++) {
  rows.push(padRow(i, count));
}*/

/*while (rows.length < count) {
  rows.push(padRow(rows.length + 1, count));
}*/

/*for (let i = count; i > 0; i--) {
  rows.push(padRow(i, count));
}*/

--fcc-editable-region--
const numbers = [1, 2, 3];

console.log(numbers);
--fcc-editable-region--

let result = ""

for (const row of rows) {
  result = result + "\n" + row;
}

console.log(result);
```
